#include "types.h"
#include "param.h"
#include "memlayout.h"
#include "riscv.h"
#include "defs.h"
#include "dtb.h"

uint64 uart0;
uint64 uart0_irq;
uint64 virtio0;
uint64 virtio0_irq;
uint64 plic;

void drivers_init(void) {
  uart0 = dtb_find_device("ns16550a", -1)->reg_base;
  uart0_irq = dtb_find_device("ns16550a", -1)->interrupt;
  plic = dtb_find_device("sifive,plic-1.0.0", -1)->reg_base;
  virtio0_irq = 1;
  virtio0 = dtb_find_device("virtio,mmio", virtio0_irq)->reg_base;
}